<template>
  <div class="message-comfirm" v-show="show">
    <div class="mask"></div>
    <div class="box">
      <div class="content">
        <slot></slot>
      </div>
      <ul class="ope-footer">
        <li @click="handleLeft">{{this.leftText?this.leftText:"取消"}}</li>
        <li @click="handleRight" :class="{disabled:rightBtnDisabled}">{{this.rightText?this.rightText:"确定"}}</li>
      </ul>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
export default {
  name: "messageComfirm",
  data() {
    return {
      show: this.visible
    };
  },
  props: ["visible","leftText","rightText","rightBtnDisabled"],
  methods: {
    handleLeft() {
      this.$emit("leftCallBack");
      this.show = false;
    },
    handleRight() {
      this.$emit("rightCallBack");
      //this.show = false;
    }
  },
  watch: {
    visible(newVal, oldVal) {
      this.show = newVal;
    }
  }
};
</script>
<style lang='scss'>
@import "messageComfirm";
</style>
